package sv.gob.mh.dgii.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "ED_SOLICITUD_CORR", schema = "EDADEPUDOC")
public class EdSolicitudCorr implements java.io.Serializable {

	private static final long serialVersionUID = 1200526885594038830L;
	
	@Id
	@Column(name = "I_INDICE", unique = true, nullable = false, precision = 18, scale = 0)
	@NotNull
	private Long iindice;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_TIPO_RESOLUCION")
	@NotNull
	@Valid
	private EdTipoResol edTipoResol;
	
	@Column(name = "B_IVA", nullable = false, precision = 1, scale = 0)
	@NotNull
	private Integer biva;
	
	@Column(name = "C_REPRESENTANTE", nullable = true, length = 2)
	private String crepresentante;
	
	@Column(name = "NIT_REP_APODE", nullable = true, length = 14)
	private String nitrepApode;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_RESOLUCION", length = 7)
	@NotNull
	private Date fhresolucion;
	
	@Column(name = "C_USUARIO_RESOL", length = 30)
	@NotNull
	private String cusuarioResol;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "F_NOTIFICACION", length = 7)
	private Date fnotificacion;
	
	@Column(name = "C_USUARIO_NOTIF", length = 30)
	private String cusuarioNotif;
	
	@Column(name = "M_ESTADO", nullable = false, length = 1)
	@NotNull
	@NotEmpty
	private String mestado;
	
	@Column(name = "N_RESOLUCION", length = 30)
	@NotNull
	@NotEmpty
	private String nresolucion;
	
	@Column(name = "NIT_IMPRENTA", length = 14)
	private String nitimprenta;
	
	@Column(name = "S_NOMBRE_IMPRENTA", length = 100)
	private String snombreImprenta;
	
	@Column(name = "S_NOMB_COMER_IMPRE", length = 100)
	private String snombComerImpre;
	
	@Column(name = "I_FIRMA", precision = 10, scale = 0)
	private Long ifirma;
	
	@Column(name = "C_UNIDAD_RECEP", nullable = false, length = 5)
	private String cunidadRecep;
	
	@Column(name = "M_TIPO_FORMULARIO", nullable = false, length = 1)
	@NotNull
	private String mtipoFormulario;
	
	@Column(name = "C_ADM_TRIB", nullable = false, length = 2)
	private String cadmTrib;
	
	@Column(name = "N_DOCUMENTO", length = 12)
	private String ndocumento;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edSolicitudCorr")
	private Set<EdDocAutorizado> edDocAutorizados = new HashSet<EdDocAutorizado>(
			0);
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edSolicitudCorr")
	private Set<EdSolDocimFunic> edSolDocimFunics = new HashSet<EdSolDocimFunic>(
			0);
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edSolicitudCorr")
	private Set<EdSolDocTiquete> edSolDocTiquetes = new HashSet<EdSolDocTiquete>(
			0);
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edSolicitudCorr")
	private Set<EdAnulaSoldoc> edAnulaSoldocs = new HashSet<EdAnulaSoldoc>(0);
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edSolicitudCorr")
	private Set<EdDirSoldoc> edDirSoldocs = new HashSet<EdDirSoldoc>(0);

	public EdSolicitudCorr() {
	}

	public EdSolicitudCorr(Long iindice, Integer biva, String crepresentante,
			String nitrepApode, String mestado, String cunidadRecep,
			String mtipoFormulario, String cadmTrib) {
		this.iindice = iindice;
		this.biva = biva;
		this.crepresentante = crepresentante;
		this.nitrepApode = nitrepApode;
		this.mestado = mestado;
		this.cunidadRecep = cunidadRecep;
		this.mtipoFormulario = mtipoFormulario;
		this.cadmTrib = cadmTrib;
	}

	public EdSolicitudCorr(Long iindice, EdTipoResol edTipoResol, Integer biva,
			String crepresentante, String nitrepApode, Date fhresolucion,
			String cusuarioResol, Date fnotificacion, String cusuarioNotif,
			String mestado, String nresolucion, String nitimprenta,
			String snombreImprenta, String snombComerImpre, Long ifirma,
			String cunidadRecep, String mtipoFormulario, String cadmTrib,
			String ndocumento, Set<EdDocAutorizado> edDocAutorizados,
			Set<EdSolDocimFunic> edSolDocimFunics,
			Set<EdSolDocTiquete> edSolDocTiquetes,
			Set<EdAnulaSoldoc> edAnulaSoldocs, Set<EdDirSoldoc> edDirSoldocs) {
		this.iindice = iindice;
		this.edTipoResol = edTipoResol;
		this.biva = biva;
		this.crepresentante = crepresentante;
		this.nitrepApode = nitrepApode;
		this.fhresolucion = fhresolucion;
		this.cusuarioResol = cusuarioResol;
		this.fnotificacion = fnotificacion;
		this.cusuarioNotif = cusuarioNotif;
		this.mestado = mestado;
		this.nresolucion = nresolucion;
		this.nitimprenta = nitimprenta;
		this.snombreImprenta = snombreImprenta;
		this.snombComerImpre = snombComerImpre;
		this.ifirma = ifirma;
		this.cunidadRecep = cunidadRecep;
		this.mtipoFormulario = mtipoFormulario;
		this.cadmTrib = cadmTrib;
		this.ndocumento = ndocumento;
		this.edDocAutorizados = edDocAutorizados;
		this.edSolDocimFunics = edSolDocimFunics;
		this.edSolDocTiquetes = edSolDocTiquetes;
		this.edAnulaSoldocs = edAnulaSoldocs;
		this.edDirSoldocs = edDirSoldocs;
	}

	
	public Long getIindice() {
		return this.iindice;
	}

	public void setIindice(Long iindice) {
		this.iindice = iindice;
	}

	
	public EdTipoResol getEdTipoResol() {
		return this.edTipoResol;
	}

	public void setEdTipoResol(EdTipoResol edTipoResol) {
		this.edTipoResol = edTipoResol;
	}

	
	public Integer getBiva() {
		return this.biva;
	}

	public void setBiva(Integer biva) {
		this.biva = biva;
	}

	
	public String getCrepresentante() {
		return this.crepresentante;
	}

	public void setCrepresentante(String crepresentante) {
		this.crepresentante = crepresentante;
	}

	
	public String getNitrepApode() {
		return this.nitrepApode;
	}

	public void setNitrepApode(String nitrepApode) {
		this.nitrepApode = nitrepApode;
	}

	
	public Date getFhresolucion() {
		return this.fhresolucion;
	}

	public void setFhresolucion(Date fhresolucion) {
		this.fhresolucion = fhresolucion;
	}

	
	public String getCusuarioResol() {
		return this.cusuarioResol;
	}

	public void setCusuarioResol(String cusuarioResol) {
		this.cusuarioResol = cusuarioResol;
	}

	
	public Date getFnotificacion() {
		return this.fnotificacion;
	}

	public void setFnotificacion(Date fnotificacion) {
		this.fnotificacion = fnotificacion;
	}

	
	public String getCusuarioNotif() {
		return this.cusuarioNotif;
	}

	public void setCusuarioNotif(String cusuarioNotif) {
		this.cusuarioNotif = cusuarioNotif;
	}

	
	public String getMestado() {
		return this.mestado;
	}

	public void setMestado(String mestado) {
		this.mestado = mestado;
	}

	
	public String getNresolucion() {
		return this.nresolucion;
	}

	public void setNresolucion(String nresolucion) {
		this.nresolucion = nresolucion;
	}

	
	public String getNitimprenta() {
		return this.nitimprenta;
	}

	public void setNitimprenta(String nitimprenta) {
		this.nitimprenta = nitimprenta;
	}

	
	public String getSnombreImprenta() {
		return this.snombreImprenta;
	}

	public void setSnombreImprenta(String snombreImprenta) {
		this.snombreImprenta = snombreImprenta;
	}

	
	public String getSnombComerImpre() {
		return this.snombComerImpre;
	}

	public void setSnombComerImpre(String snombComerImpre) {
		this.snombComerImpre = snombComerImpre;
	}

	
	public Long getIfirma() {
		return this.ifirma;
	}

	public void setIfirma(Long ifirma) {
		this.ifirma = ifirma;
	}

	
	public String getCunidadRecep() {
		return this.cunidadRecep;
	}

	public void setCunidadRecep(String cunidadRecep) {
		this.cunidadRecep = cunidadRecep;
	}

	
	public String getMtipoFormulario() {
		return this.mtipoFormulario;
	}

	public void setMtipoFormulario(String mtipoFormulario) {
		this.mtipoFormulario = mtipoFormulario;
	}

	
	public String getCadmTrib() {
		return this.cadmTrib;
	}

	public void setCadmTrib(String cadmTrib) {
		this.cadmTrib = cadmTrib;
	}

	
	public String getNdocumento() {
		return this.ndocumento;
	}

	public void setNdocumento(String ndocumento) {
		this.ndocumento = ndocumento;
	}

	
	public Set<EdDocAutorizado> getEdDocAutorizados() {
		return this.edDocAutorizados;
	}

	public void setEdDocAutorizados(Set<EdDocAutorizado> edDocAutorizados) {
		this.edDocAutorizados = edDocAutorizados;
	}

	
	public Set<EdSolDocimFunic> getEdSolDocimFunics() {
		return this.edSolDocimFunics;
	}

	public void setEdSolDocimFunics(Set<EdSolDocimFunic> edSolDocimFunics) {
		this.edSolDocimFunics = edSolDocimFunics;
	}

	
	public Set<EdSolDocTiquete> getEdSolDocTiquetes() {
		return this.edSolDocTiquetes;
	}

	public void setEdSolDocTiquetes(Set<EdSolDocTiquete> edSolDocTiquetes) {
		this.edSolDocTiquetes = edSolDocTiquetes;
	}

	
	public Set<EdAnulaSoldoc> getEdAnulaSoldocs() {
		return this.edAnulaSoldocs;
	}

	public void setEdAnulaSoldocs(Set<EdAnulaSoldoc> edAnulaSoldocs) {
		this.edAnulaSoldocs = edAnulaSoldocs;
	}
	
	public Set<EdDirSoldoc> getEdDirSoldocs() {
		return this.edDirSoldocs;
	}

	public void setEdDirSoldocs(Set<EdDirSoldoc> edDirSoldocs) {
		this.edDirSoldocs = edDirSoldocs;
	}

}
